|
vacuum2 2.2.1
|
API for configuring and manipulating Vacuum 2 Click driver. More...
Topics | |
| Vacuum 2 Settings | |
| Settings of Vacuum 2 Click driver. | |
| Vacuum 2 MikroBUS Map | |
| MikroBUS pin mapping of Vacuum 2 Click driver. | |
Functions | |
| void | vacuum2_cfg_setup (vacuum2_cfg_t *cfg) |
| Vacuum 2 configuration object setup function. | |
| void | vacuum2_drv_interface_sel (vacuum2_cfg_t *cfg, vacuum2_drv_t drv_sel) |
| Vacuum 2 driver interface setup function. | |
| err_t | vacuum2_init (vacuum2_t *ctx, vacuum2_cfg_t *cfg) |
| Vacuum 2 initialization function. | |
| err_t | vacuum2_read_adc_raw (vacuum2_t *ctx, uint16_t *raw_adc) |
| Vacuum 2 read raw ADC value function. | |
| err_t | vacuum2_read_adc_voltage (vacuum2_t *ctx, float *voltage) |
| Vacuum 2 read voltage level function. | |
| err_t | vacuum2_set_vref (vacuum2_t *ctx, float vref) |
| Vacuum 2 set vref function. | |
| err_t | vacuum2_read_vout (vacuum2_t *ctx, float *vout) |
| Vacuum 2 read vout function. | |
| err_t | vacuum2_read_vout_avg (vacuum2_t *ctx, uint16_t num_conv, float *vout_avg) |
| Vacuum 2 read vout avg function. | |
| err_t | vacuum2_calib_offset (vacuum2_t *ctx) |
| Vacuum 2 calib offset function. | |
| err_t | vacuum2_read_pressure (vacuum2_t *ctx, int16_t *pressure) |
| Vacuum 2 read pressure function. | |
API for configuring and manipulating Vacuum 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| err_t vacuum2_calib_offset | ( | vacuum2_t * | ctx | ) |
Vacuum 2 calib offset function.
This function calibrates the zero current offset value.
| [in] | ctx | : Click context object. See vacuum2_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void vacuum2_cfg_setup | ( | vacuum2_cfg_t * | cfg | ) |
Vacuum 2 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See vacuum2_cfg_t object definition for detailed explanation. |
| void vacuum2_drv_interface_sel | ( | vacuum2_cfg_t * | cfg, |
| vacuum2_drv_t | drv_sel ) |
Vacuum 2 driver interface setup function.
This function sets a serial driver interface which will be used further in the Click driver.
| [out] | cfg | : Click configuration structure. See vacuum2_cfg_t object definition for detailed explanation. |
| [in] | drv_sel | : Driver interface selection. See vacuum2_drv_t object definition for detailed explanation. |
| err_t vacuum2_init | ( | vacuum2_t * | ctx, |
| vacuum2_cfg_t * | cfg ) |
Vacuum 2 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See vacuum2_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See vacuum2_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vacuum2_read_adc_raw | ( | vacuum2_t * | ctx, |
| uint16_t * | raw_adc ) |
Vacuum 2 read raw ADC value function.
This function reads raw ADC value.
| [in] | ctx | : Click context object. See vacuum2_t object definition for detailed explanation. |
| [out] | raw_adc | : Output ADC result. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vacuum2_read_adc_voltage | ( | vacuum2_t * | ctx, |
| float * | voltage ) |
Vacuum 2 read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
| [in] | ctx | : Click context object. See vacuum2_t object definition for detailed explanation. |
| [out] | voltage | : Output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vacuum2_read_pressure | ( | vacuum2_t * | ctx, |
| int16_t * | pressure ) |
Vacuum 2 read pressure function.
This function reads the pressure measurement.
| [in] | ctx | : Click context object. See vacuum2_t object definition for detailed explanation. |
| [out] | pressure | : Pressure level [Pa]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vacuum2_read_vout | ( | vacuum2_t * | ctx, |
| float * | vout ) |
Vacuum 2 read vout function.
This function reads the sensor output voltage.
| [in] | ctx | : Click context object. See vacuum2_t object definition for detailed explanation. |
| [out] | vout | : Output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vacuum2_read_vout_avg | ( | vacuum2_t * | ctx, |
| uint16_t | num_conv, | ||
| float * | vout_avg ) |
Vacuum 2 read vout avg function.
This function reads a desired number of sensor voltage output samples and averages it.
| [in] | ctx | : Click context object. See vacuum2_t object definition for detailed explanation. |
| [in] | num_conv | : Number of ADC samples. |
| [out] | vout_avg | : Average output voltage level [V]. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t vacuum2_set_vref | ( | vacuum2_t * | ctx, |
| float | vref ) |
Vacuum 2 set vref function.
This function sets the voltage reference for Vacuum 2 Click driver.
| [in] | ctx | : Click context object. See vacuum2_t object definition for detailed explanation. |
| [in] | vref | : Reference voltage (volts). |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.